package com.example.mybank.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.mybank.entity.Buycount;
import com.example.mybank.entity.Product;
import com.example.mybank.entity.Users;
import com.example.mybank.mapper.BuycountMapper;
import com.example.mybank.mapper.ProductMapper;
import com.example.mybank.tool.MyException;
import com.example.mybank.tool.ResultCode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class ProductService {

    @Autowired
    ProductMapper productMapper;

    @Autowired
    BuycountMapper buycountMapper;

    @Autowired
    EngineService engineService;

    public boolean endPassXmins(Product product,int mins){
        if(product.getTime_end().before(new Date(System.currentTimeMillis()-mins*60*1000))){
            return true;
        }
        return false;
    }
}
